package com.example.ams.dto;

import com.example.ams.entity.ClockRecord;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 打卡记录数据传输对象
 * Clock Record Data Transfer Object
 */
public class ClockRecordDTO {

    private Long id;

    @NotNull(message = "员工ID不能为空")
    private Long employeeId;

    private String employeeName;  // 员工姓名（用于显示）

    private String empNo;  // 工号（用于显示）

    @NotNull(message = "打卡时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date eventTime;

    @NotNull(message = "事件类型不能为空")
    private ClockRecord.EventType eventType;

    private ClockRecord.Source source = ClockRecord.Source.DEVICE;

    private String remark;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createdAt;

    // Constructors
    public ClockRecordDTO() {
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(Long employeeId) {
        this.employeeId = employeeId;
    }

    public String getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }

    public String getEmpNo() {
        return empNo;
    }

    public void setEmpNo(String empNo) {
        this.empNo = empNo;
    }

    public Date getEventTime() {
        return eventTime;
    }

    public void setEventTime(Date eventTime) {
        this.eventTime = eventTime;
    }

    public ClockRecord.EventType getEventType() {
        return eventType;
    }

    public void setEventType(ClockRecord.EventType eventType) {
        this.eventType = eventType;
    }

    public ClockRecord.Source getSource() {
        return source;
    }

    public void setSource(ClockRecord.Source source) {
        this.source = source;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }
}

